package lib.messaging;

import java.io.IOException;

/**
 * Interface for packet receive operations
 *
 * @author abhip
 *
 */
public interface IReceiver {
    /**
     * Receives messages
     * @param port on which to receive data
     * @return message received
     * @throws IOException
     * @throws ClassNotFoundException
     */
    byte[] ReceiveBytes(int port) throws IOException, ClassNotFoundException;

    /**
     * Receive message but wait for only specified timeout
     *
     * @param port on which to receive data
     * @param timeout
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    byte[] ReceiveBytes(int port, int timeout) throws IOException, ClassNotFoundException;
}
